<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
//     return $router->app->version();
    return redirect('/home/index.html');
});


$router->get('admin', function () use ($router) {
    return redirect('/admin/index.html');
});


//后台接口
$router->group(['prefix'=>'api/admin','namespace'=>'Admin'],function () use ($router) {
    $router->post('dologin','LoginController@dologin');
    $router->post('modify','LoginController@setAdmin');
    $router->post('tongji','IndexController@getTongji');
    //多语言
    $router->post('front/index','FrontController@getIndex');
    $router->post('front/modify','FrontController@setUpdate');
    $router->post('lang/index','FrontController@getLangIndex');
    //首页横图
    $router->post('ad/index','FrontController@getAdIndex');
    $router->post('ad/add','FrontController@setAdAdd');
    $router->post('ad/del','FrontController@setAdDel');
    //赞助商
    $router->post('zanzhu/index','FrontController@getSponsorIndex');
    $router->post('zanzhu/add','FrontController@setSponsorAdd');
    $router->post('zanzhu/del','FrontController@setSponsorDel');
    //大会视频
    $router->post('video/index','VideoController@getVideoIndex');
    $router->post('video/upload','VideoController@setUpload');
    $router->post('video/add','VideoController@setVideoAdd');
    $router->post('video/del','VideoController@setVideoDel');
    //大会
    $router->post('dahui/intro/one','IndexController@getDhIntro'); //大会介绍获取
    $router->post('dahui/intro/modify','IndexController@setDhIntro'); //大会介绍修改
    $router->post('dahui/agenda/one','IndexController@getAgenda'); //大会议程获取
    $router->post('dahui/agenda/modify','IndexController@setAgenda'); //大会议程修改
    //大会相关
    $router->post('meet/index','MeetController@getIndex');
    $router->post('meet/add','MeetController@setAdd');
    $router->post('meet/one','MeetController@getOne');
    $router->post('meet/modify','MeetController@setUpdate');
    $router->post('meet/del','MeetController@setDel');
    $router->post('meet/option','MeetController@getOption');
    //聚焦
    $router->post('meet/focus/index','MeetController@getFocusIndex');
    $router->post('meet/focus/add','MeetController@setFocusAdd');
    $router->get('meet/focus/upload','MeetController@setFocusUploadConfig');
    $router->post('meet/focus/upload','MeetController@setFocusUpload');
    $router->post('meet/focus/one','MeetController@getFocusOne');
    $router->post('meet/focus/modify','MeetController@setFocusUpdate');
    $router->post('meet/focus/del','MeetController@setFocusDel');
    //嘉宾
    $router->post('meet/speaker/index','MeetController@getSpeakerIndex');
    $router->post('meet/speaker/add','MeetController@setSpeakerAdd');
    $router->post('meet/speaker/del','MeetController@setSpeakerDel');
    //大会章程
    $router->post('meet/way/one','MeetController@getWay');
    $router->post('meet/way/modify','MeetController@setWay');
    //大会报名
    $router->post('meet/signup/one','MeetController@getSignup');
    $router->post('meet/signup/modify','MeetController@setSignup');
    //大会奖项
    $router->post('meet/award/one','MeetController@getAward');
    $router->post('meet/award/modify','MeetController@setAward');
    //安全伦理
    $router->post('meet/safety/one','MeetController@getSafety');
    $router->post('meet/safety/modify','MeetController@setSafety');
    //资料上传
    $router->post('meet/file/index','MeetController@getFileIndex');
    $router->post('meet/file/upload','MeetController@setFileUpload');
    $router->post('meet/file/add','MeetController@setFileAdd');
    $router->post('meet/file/del','MeetController@setFileDel');
    //学术委员会
    $router->post('learn/index','IndexController@getLearnIndex');
    $router->post('learn/add','IndexController@setLearnAdd');
    $router->post('learn/one','IndexController@getLearnOne');
    $router->post('learn/modify','IndexController@setLearnUpdate');
    $router->post('learn/del','IndexController@setLearnDel');
    //组织架构
    $router->post('zzjg/one','IndexController@getZzjg');
    $router->post('zzjg/modify','IndexController@setZzjg');
    //影像馆
    $router->post('yxg/index','IndexController@getYxgIndex');
    $router->post('yxg/add','IndexController@setYxgAdd');
    $router->post('yxg/del','IndexController@setYxgDel');
    //联系我们
    $router->post('lianxi/one','IndexController@getLianxi');
    $router->post('lianxi/modify','IndexController@setLianxi');
});


//前台接口
$router->group(['prefix'=>'api/home','namespace'=>'Home'],function () use ($router) {
    $router->get('/',function(){echo '<pre>';var_dump($_SERVER);});
    $router->post('/','FrontController@client');
    //前台菜单
    $router->post('front/banner','FrontController@getBanner');
    $router->post('front/lang','FrontController@getLang');
    //首页
    $router->post('shouye','FrontController@shouye');
    $router->post('shouye/videdo/index','FrontController@getVideoIndex');
    $router->post('trend','TrendController@getTrendIndex'); //大会动态
    //章程、报名、奖项、安全、资料
    $router->post('dh/index','TrendController@getDhIndex');
    //学术委员会
    $router->post('dh/learn','TrendController@getLearnIndex');
    //关于我们
    $router->post('dh/about','TrendController@getAboutIndex');
});